import React, { memo, useEffect, useRef } from "react";
import { EntireWrapper } from "@/views/entire/style";
import EntireFilter from "@/views/entire/c-cpns/entire-filter";
import EntireRooms from "@/views/entire/c-cpns/entire-rooms";
import EntirePagination from "@/views/entire/c-cpns/entire-pagination";
import { useDispatch, useSelector } from "react-redux";
import {  fetchRoomListAction } from "@/store/modules/entire/actionCreators";
import { changeHeaderConfigAction } from '@/store/modules/main'

const Index = memo(() => {
  const dispatch = useDispatch();
  useEffect(() => {
    dispatch(fetchRoomListAction());
    dispatch(changeHeaderConfigAction({isFixed: true, isHome: false}))
  }, [dispatch]);

  return (
    <EntireWrapper>
      <EntireFilter></EntireFilter>
      <EntireRooms></EntireRooms>
      <EntirePagination></EntirePagination>
    </EntireWrapper>
  );
});

export default Index;
